package com.lt.mapper;

import com.lt.entity.Teacher;
import com.lt.entity.Tutor;
import org.apache.ibatis.annotations.Select;

/**
 * @Author :liteng
 * @Time : 2023/11/3 22:32
 */
public interface TeacherMapper {

    /**
     * 教师是否存在
     *
     * @param teacherNum 教师编号
     * @return 布尔
     */
    @Select("select exists(select 1 from teacher where teacher_num=#{teacherNum})")
    Boolean existTeacher(Long teacherNum);


    /**
     * 插入老师
     *
     * @param teacher
     * @return 老师主键
     */
    void insertTeacher(Teacher teacher);

    /**
     * 返回教师主键
     *
     * @param teacherNum 老师教师号
     * @return 教师主键
     */
    Long selectTeacherId(Long teacherNum);

    /**
     * 插入企业导师
     *
     * @param tutor
     * @return 导师主键
     */
    void insertTutor(Tutor tutor);

    /**
     * 根据老师编号查询一条老师记录
     * @param teacherNum
     * @return
     */
    Teacher selectTeacherByNum(Long teacherNum);

}
